.class public abstract Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;
.super Ljava/lang/Object;
.source "EdgeEndStar.java"


# instance fields
.field protected edgeList:Ljava/util/List;

.field protected edgeMap:Ljava/util/Map;

.field private ptInAreaLocation:[I


# direct methods
.method public constructor <init>()V
    .locals 1

    .line 68
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 57
    new-instance v0, Ljava/util/TreeMap;

    invoke-direct {v0}, Ljava/util/TreeMap;-><init>()V

    iput-object v0, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->edgeMap:Ljava/util/Map;

    const/4 v0, 0x2

    .line 65
    new-array v0, v0, [I

    fill-array-data v0, :array_0

    iput-object v0, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->ptInAreaLocation:[I

    return-void

    nop

    :array_0
    .array-data 4
        -0x1
        -0x1
    .end array-data
.end method

.method private computeEdgeEndLabels(Lcom/vividsolutions/jts/algorithm/BoundaryNodeRule;)V
    .locals 2

    .line 207
    invoke-virtual {p0}, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 208
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;

    .line 209
    invoke-virtual {v1, p1}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->computeLabel(Lcom/vividsolutions/jts/algorithm/BoundaryNodeRule;)V

    goto :goto_0

    :cond_0
    return-void
.end method


# virtual methods
.method public computeLabelling([Lcom/vividsolutions/jts/geomgraph/GeometryGraph;)V
    .locals 8

    const/4 v0, 0x0

    .line 131
    aget-object v1, p1, v0

    invoke-virtual {v1}, Lcom/vividsolutions/jts/geomgraph/GeometryGraph;->getBoundaryNodeRule()Lcom/vividsolutions/jts/algorithm/BoundaryNodeRule;

    move-result-object v1

    invoke-direct {p0, v1}, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->computeEdgeEndLabels(Lcom/vividsolutions/jts/algorithm/BoundaryNodeRule;)V

    .line 135
    invoke-virtual {p0, v0}, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->propagateSideLabels(I)V

    const/4 v1, 0x1

    .line 138
    invoke-virtual {p0, v1}, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->propagateSideLabels(I)V

    const/4 v2, 0x2

    .line 171
    new-array v3, v2, [Z

    fill-array-data v3, :array_0

    .line 172
    invoke-virtual {p0}, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->iterator()Ljava/util/Iterator;

    move-result-object v4

    :cond_0
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-eqz v5, :cond_2

    .line 173
    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;

    .line 174
    invoke-virtual {v5}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->getLabel()Lcom/vividsolutions/jts/geomgraph/Label;

    move-result-object v5

    const/4 v6, 0x0

    :goto_0
    if-ge v6, v2, :cond_0

    .line 176
    invoke-virtual {v5, v6}, Lcom/vividsolutions/jts/geomgraph/Label;->isLine(I)Z

    move-result v7

    if-eqz v7, :cond_1

    invoke-virtual {v5, v6}, Lcom/vividsolutions/jts/geomgraph/Label;->getLocation(I)I

    move-result v7

    if-ne v7, v1, :cond_1

    .line 177
    aput-boolean v1, v3, v6

    :cond_1
    add-int/lit8 v6, v6, 0x1

    goto :goto_0

    .line 181
    :cond_2
    invoke-virtual {p0}, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :cond_3
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_6

    .line 182
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;

    .line 183
    invoke-virtual {v4}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->getLabel()Lcom/vividsolutions/jts/geomgraph/Label;

    move-result-object v5

    const/4 v6, 0x0

    :goto_1
    if-ge v6, v2, :cond_3

    .line 186
    invoke-virtual {v5, v6}, Lcom/vividsolutions/jts/geomgraph/Label;->isAnyNull(I)Z

    move-result v7

    if-eqz v7, :cond_5

    .line 188
    aget-boolean v7, v3, v6

    if-eqz v7, :cond_4

    const/4 v7, 0x2

    goto :goto_2

    .line 192
    :cond_4
    invoke-virtual {v4}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->getCoordinate()Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v7

    .line 193
    invoke-virtual {p0, v6, v7, p1}, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->getLocation(ILcom/vividsolutions/jts/geom/Coordinate;[Lcom/vividsolutions/jts/geomgraph/GeometryGraph;)I

    move-result v7

    .line 195
    :goto_2
    invoke-virtual {v5, v6, v7}, Lcom/vividsolutions/jts/geomgraph/Label;->setAllLocationsIfNull(II)V

    :cond_5
    add-int/lit8 v6, v6, 0x1

    goto :goto_1

    :cond_6
    return-void

    nop

    :array_0
    .array-data 1
        0x0t
        0x0t
    .end array-data
.end method

.method public findIndex(Lcom/vividsolutions/jts/geomgraph/EdgeEnd;)I
    .locals 2

    .line 320
    invoke-virtual {p0}, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->iterator()Ljava/util/Iterator;

    const/4 v0, 0x0

    .line 321
    :goto_0
    iget-object v1, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->edgeList:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    if-ge v0, v1, :cond_1

    .line 322
    iget-object v1, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->edgeList:Ljava/util/List;

    invoke-interface {v1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;

    if-ne v1, p1, :cond_0

    return v0

    :cond_0
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :cond_1
    const/4 p1, -0x1

    return p1
.end method

.method public getCoordinate()Lcom/vividsolutions/jts/geom/Coordinate;
    .locals 2

    .line 92
    invoke-virtual {p0}, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .line 93
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-nez v1, :cond_0

    const/4 v0, 0x0

    return-object v0

    .line 94
    :cond_0
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;

    .line 95
    invoke-virtual {v0}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->getCoordinate()Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v0

    return-object v0
.end method

.method public getEdges()Ljava/util/List;
    .locals 2

    .line 114
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->edgeList:Ljava/util/List;

    if-nez v0, :cond_0

    .line 115
    new-instance v0, Ljava/util/ArrayList;

    iget-object v1, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->edgeMap:Ljava/util/Map;

    invoke-interface {v1}, Ljava/util/Map;->values()Ljava/util/Collection;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V

    iput-object v0, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->edgeList:Ljava/util/List;

    .line 117
    :cond_0
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->edgeList:Ljava/util/List;

    return-object v0
.end method

.method getLocation(ILcom/vividsolutions/jts/geom/Coordinate;[Lcom/vividsolutions/jts/geomgraph/GeometryGraph;)I
    .locals 3

    .line 215
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->ptInAreaLocation:[I

    aget v1, v0, p1

    const/4 v2, -0x1

    if-ne v1, v2, :cond_0

    .line 216
    aget-object p3, p3, p1

    invoke-virtual {p3}, Lcom/vividsolutions/jts/geomgraph/GeometryGraph;->getGeometry()Lcom/vividsolutions/jts/geom/Geometry;

    move-result-object p3

    invoke-static {p2, p3}, Lcom/vividsolutions/jts/algorithm/SimplePointInAreaLocator;->locate(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Geometry;)I

    move-result p2

    aput p2, v0, p1

    .line 218
    :cond_0
    iget-object p2, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->ptInAreaLocation:[I

    aget p1, p2, p1

    return p1
.end method

.method public abstract insert(Lcom/vividsolutions/jts/geomgraph/EdgeEnd;)V
.end method

.method protected insertEdgeEnd(Lcom/vividsolutions/jts/geomgraph/EdgeEnd;Ljava/lang/Object;)V
    .locals 1

    .line 83
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->edgeMap:Ljava/util/Map;

    invoke-interface {v0, p1, p2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const/4 p1, 0x0

    .line 84
    iput-object p1, p0, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->edgeList:Ljava/util/List;

    return-void
.end method

.method public iterator()Ljava/util/Iterator;
    .locals 1

    .line 110
    invoke-virtual {p0}, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->getEdges()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    return-object v0
.end method

.method propagateSideLabels(I)V
    .locals 10

    .line 272
    invoke-virtual {p0}, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->iterator()Ljava/util/Iterator;

    move-result-object v0

    const/4 v1, -0x1

    const/4 v2, -0x1

    :cond_0
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    const/4 v4, 0x1

    if-eqz v3, :cond_1

    .line 273
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;

    .line 274
    invoke-virtual {v3}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->getLabel()Lcom/vividsolutions/jts/geomgraph/Label;

    move-result-object v3

    .line 275
    invoke-virtual {v3, p1}, Lcom/vividsolutions/jts/geomgraph/Label;->isArea(I)Z

    move-result v5

    if-eqz v5, :cond_0

    invoke-virtual {v3, p1, v4}, Lcom/vividsolutions/jts/geomgraph/Label;->getLocation(II)I

    move-result v5

    if-eq v5, v1, :cond_0

    .line 276
    invoke-virtual {v3, p1, v4}, Lcom/vividsolutions/jts/geomgraph/Label;->getLocation(II)I

    move-result v2

    goto :goto_0

    :cond_1
    if-ne v2, v1, :cond_2

    return-void

    .line 282
    :cond_2
    invoke-virtual {p0}, Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :cond_3
    :goto_1
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_9

    .line 283
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;

    .line 284
    invoke-virtual {v3}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->getLabel()Lcom/vividsolutions/jts/geomgraph/Label;

    move-result-object v5

    const/4 v6, 0x0

    .line 286
    invoke-virtual {v5, p1, v6}, Lcom/vividsolutions/jts/geomgraph/Label;->getLocation(II)I

    move-result v7

    if-ne v7, v1, :cond_4

    .line 287
    invoke-virtual {v5, p1, v6, v2}, Lcom/vividsolutions/jts/geomgraph/Label;->setLocation(III)V

    .line 290
    :cond_4
    invoke-virtual {v5, p1}, Lcom/vividsolutions/jts/geomgraph/Label;->isArea(I)Z

    move-result v7

    if-eqz v7, :cond_3

    .line 291
    invoke-virtual {v5, p1, v4}, Lcom/vividsolutions/jts/geomgraph/Label;->getLocation(II)I

    move-result v7

    const/4 v8, 0x2

    .line 292
    invoke-virtual {v5, p1, v8}, Lcom/vividsolutions/jts/geomgraph/Label;->getLocation(II)I

    move-result v9

    if-eq v9, v1, :cond_7

    if-ne v9, v2, :cond_6

    if-eq v7, v1, :cond_5

    move v2, v7

    goto :goto_1

    .line 299
    :cond_5
    new-instance p1, Ljava/lang/StringBuffer;

    invoke-direct {p1}, Ljava/lang/StringBuffer;-><init>()V

    const-string v0, "found single null side (at "

    invoke-virtual {p1, v0}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    invoke-virtual {v3}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->getCoordinate()Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v0

    invoke-virtual {p1, v0}, Ljava/lang/StringBuffer;->append(Ljava/lang/Object;)Ljava/lang/StringBuffer;

    const-string v0, ")"

    invoke-virtual {p1, v0}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    invoke-virtual {p1}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-static {p1}, Lcom/vividsolutions/jts/util/Assert;->shouldNeverReachHere(Ljava/lang/String;)V

    const/4 p1, 0x0

    throw p1

    .line 297
    :cond_6
    new-instance p1, Lcom/vividsolutions/jts/geom/TopologyException;

    invoke-virtual {v3}, Lcom/vividsolutions/jts/geomgraph/EdgeEnd;->getCoordinate()Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v0

    const-string v1, "side location conflict"

    invoke-direct {p1, v1, v0}, Lcom/vividsolutions/jts/geom/TopologyException;-><init>(Ljava/lang/String;Lcom/vividsolutions/jts/geom/Coordinate;)V

    throw p1

    .line 310
    :cond_7
    invoke-virtual {v5, p1, v4}, Lcom/vividsolutions/jts/geomgraph/Label;->getLocation(II)I

    move-result v3

    if-ne v3, v1, :cond_8

    const/4 v6, 0x1

    :cond_8
    const-string v3, "found single null side"

    invoke-static {v6, v3}, Lcom/vividsolutions/jts/util/Assert;->isTrue(ZLjava/lang/String;)V

    .line 311
    invoke-virtual {v5, p1, v8, v2}, Lcom/vividsolutions/jts/geomgraph/Label;->setLocation(III)V

    .line 312
    invoke-virtual {v5, p1, v4, v2}, Lcom/vividsolutions/jts/geomgraph/Label;->setLocation(III)V

    goto :goto_1

    :cond_9
    return-void
.end method
